#ifndef DBADAPTER_H
#define DBADAPTER_H

#include <QObject>
#include <QSqlDatabase>

class dbargs;
//This class is used as a base class for database adapters
class DBAdapter : public QObject
{
	Q_OBJECT

public:
	DBAdapter(QObject *parent, QSqlDatabase *_db);
	~DBAdapter();

	QSqlDatabase *db;


	/**
	* Creates connection with database using data from dbargs dialog
	*/
	virtual bool createConnection(dbargs *args);
	/**
	* Return select query to get id of last inserted row
	*/
	virtual QString lastInsertIdQuery()=0;
	/**
	* Return string with concatenation of string list for given DB
	*/
	virtual QString concat(QStringList &args)=0;
	/**
	* Returns true if db is local and in need of merging via import/export, false if not needed
	*/
	virtual bool localDb()=0;

private:
	
};

#endif // DBADAPTER_H
